<?php
    session_start();
    if($_SESSION['uid']==""||$_SESSION['level']==""){
		header("Location: ../exit.php");
		exit();
	}
    include('/tool/submitValidate.php');
    include('/tool/pdo.php');
    include('/class/reset-password.class.php');
    include('/bll/ResetPasswordBLL.php');

    $password=isset($_POST['password'])?$_POST['password']:'';
    $passwordNew=isset($_POST['new_password'])?$_POST['new_password']:'';

    $resetPasswordBLL=new ResetPasswordBLL();
    $result=$resetPasswordBLL->resetPassword($_SESSION['uid'],$password,$passwordNew);

    echo json_encode($result,JSON_UNESCAPED_UNICODE);
?>